<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
</head>
<body>
	<button>输出响应体数据</button>
	<button>弹出响应体数据</button>
</body>
<script src="./lib/ajax.js"></script>
<script>
	const btns = document.querySelectorAll("button");
	btns[0].onclick = function(){
		// ajax({
		// 	url:"https://m.maizuo.com/gateway",
		// 	params:{
		// 		cityId:310100,
		// 		pageNum:1,
		// 		pageSize:10,
		// 		type:1
		// 	},
		// 	headers:{
		// 		"X-Client-Info": '{"a":"3000","ch":"1002","v":"5.2.1","e":"16809390192768020522926081","bc":"310100"}',
		// 		"X-Host": "mall.film-ticket.film.list"
		// 	},
		// 	success(data){
		// 		console.log(data);
		// 	}
		// });
		
		ajax.get("https://m.maizuo.com/gateway",{
			params:{
				cityId:310100,
				pageNum:1,
				pageSize:10,
				type:1
			},
			headers:{
				"X-Client-Info": '{"a":"3000","ch":"1002","v":"5.2.1","e":"16809390192768020522926081","bc":"310100"}',
				"X-Host": "mall.film-ticket.film.list"
			},
			success(data){
				console.log(data);
			}
		})
	};
	btns[1].onclick = function(){
		ajax({
			method:"get",
			url:"./b.json",
			success(data) {
				alert(data);
			}
		});
	}
</script>
</html>